.TH E1432_SRCBUFFER_INIT 3 E1432
.SH NAME
.nf
e1432_set_srcbuffer_mode \- Set the source ARB buffer mode
e1432_get_srcbuffer_mode \- Get the current source ARB buffer mode
e1432_set_srcbuffer_size \- Set the source ARB buffer size
e1432_get_srcbuffer_size \- Get the current source ARB buffer size
e1432_set_srcbuffer_init \- Initialize the source ARB buffers
e1432_get_srcbuffer_init \- Get the source ARB buffer initialization value
.fi
.IX e1432_set_srcbuffer_mode(3) 3
.IX e1432_get_srcbuffer_mode(3) 3
.IX e1432_set_srcbuffer_size(3) 3
.IX e1432_get_srcbuffer_size(3) 3
.IX e1432_set_srcbuffer_init(3) 3
.IX e1432_get_srcbuffer_init(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_srcbuffer_mode(E1432ID hw, SHORTSIZ16 ID,
                                    SHORTSIZ16 mode)
SHORTSIZ16 e1432_get_srcbuffer_mode(E1432ID hw, SHORTSIZ16 ID,
                                    SHORTSIZ16 *mode)
SHORTSIZ16 e1432_set_srcbuffer_size(E1432ID hw, SHORTSIZ16 ID,
                                    LONGSIZ32 size)
SHORTSIZ16 e1432_get_srcbuffer_size(E1432ID hw, SHORTSIZ16 ID,
                                    LONGSIZ32 *size)
SHORTSIZ16 e1432_set_srcbuffer_init(E1432ID hw, SHORTSIZ16 ID,
                                    SHORTSIZ16 initmode)
SHORTSIZ16 e1432_get_srcbuffer_init(E1432ID hw, SHORTSIZ16 ID,
                                    SHORTSIZ16 *initmode)
.cE
.SH DESCRIPTION
These functions specify how the option 1D4 single-channel source will
work, when the source is in mode \fBE1432_SOURCE_MODE_ARB\fR and
mode \fBE1432_SOURCE_MODE_BARB\fR.

For all of these functions, \fIhw\fR must be the result of a
successful call to \fIe1432_assign_channel_numbers\fR, and specifies
the group of hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained with a
call to \fIe1432_create_channel_group\fR, or the ID of a single channel.

\fIe1432_set_srcbuffer_mode\fR sets the buffer operation mode for the
source addressed.  The values for \fImode\fR are:

\fBE1432_SRCBUFFER_PERIODIC_A\fR specifies that the source will loop
on one buffer of data (the A buffer).  The buffer size is determined
by \fIe1432_set_srcbuffer_size\fR.  This source buffer mode works for
both source mode \fBE1432_SOURCE_MODE_ARB\fR and source mode
\fBE1432_SOURCE_MODE_BARB\fR.

\fBE1432_SRCBUFFER_PERIODIC_AB\fR specifies that the source will loop
on the both the A and B buffer (concatenated).  The total buffer size
is twice that set by \fIe1432_set_srcbuffer_size\fR.  This source
buffer mode works for both source mode \fBE1432_SOURCE_MODE_ARB\fR and
source mode \fBE1432_SOURCE_MODE_BARB\fR.

\fBE1432_SRCBUFFER_CONTINUOUS\fR specifies that data will be
continually loaded into the source from the host and played back at a
rate determined by the source frequency parameters.  In the event that
insufficient data is available, the source will replay its last data
point and an source overread status condition will be set.  This mode
uses both A and B buffers, alternately.  Note: The at least one of the
two source buffers must be pre-loaded with data prior to starting a
measurement.  This source buffer mode works only for source mode
\fBE1432_SOURCE_MODE_ARB\fR, and not for \fBE1432_SOURCE_MODE_BARB\fR.

\fBE1432_SRCBUFFER_ONESHOT\fR specifies that one buffer of data will
be sent out, and then the source will stop.  When the source stops, it
goes back to zero volts output.  The buffer size is determined by
\fIe1432_set_srcbuffer_size\fR.  Only the A buffer is used in this
mode, and this buffer should be pre-loaded before starting a
measurement.  This source buffer mode works only for source mode
\fBE1432_SOURCE_MODE_ARB\fR, and not for \fBE1432_SOURCE_MODE_BARB\fR.

\fIe1432_set_srcbuffer_size\fR sets the source buffer size in the
source itself.  The source contains two buffers which are
each set to \fIsize\fR words.

\fIe1432_set_srcbuffer_init\fR initializes the source buffers as well
as the substrate buffers.  Two initialization options are specified by
the values of \fIinitmode\fR:

\fBE1432_SRCBUFFER_INIT_EMPTY\fR resets all buffers, substrate and
source board, to empty.

\fBE1432_SRCBUFFER_INIT_XFER\fR resets all transfer buffers (substrate)
only.

It is important to note that a \fIe1432_set_srcbuffer_init\fR call is
necessary in order for new values of \fImode\fR and \fIsize\fR to take
effect.

.SH "SOURCE DRAM USAGE"

If an E1434 has DRAM installed, then the DRAM can be used to allow a
larger-than-normal source buffer.  This works only when the source
buffer is in \fBE1432_SRCBUFFER_ONESHOT\fR of
\fBE1432_SRCBUFFER_PERIODIC_A\fR modes, and allows for a large buffer
of data to be loaded and then sent out the source.  For E1432 or E1433
modules that have an option 1D4 source board installed, DRAM may also
be used for a large source buffer, but only if there are \fBno\fR
active input channels in the module.

The DRAM is split evenly among the active source channels in the
module.  However, on an E1434, if channel 2 is active but channel 1 is
not active, then some of the DRAM is wasted on an unused buffer for
channel 1.  Similarly, if channel 4 is active but channel 3 is not
active, then some of the DRAM is wasted on an unused buffer for
channel 3.  This means that the maximum source buffer size will be
smaller than if the DRAM were not wasted.  To avoid this situation,
always use channel 1 or channel 3 when you only need one active source
channel.

Each source sample takes up four bytes of DRAM.  So, for example, if
only source channel 1 is active and the DRAM size is 32 MB, then the
source buffer can hold 8388608 samples.  At a sample rate of 65536 Hz,
this is 128 seconds of output signal.

A call to \fIe1432_set_srcbuffer_size\fR should specify the desired
source buffer size.  There is no special function to turn on the use
of DRAM.  DRAM is used automatically if it is available and the
specified source buffer size is large enough to need it.  Other than
making a larger source buffer available to the host, the use of DRAM
is transparent to the host program.

When using DRAM as a large source buffer,
\fIe1432_write_srcbuffer_data\fR is no longer restricted to a transfer
size of \fBE1432_SRC_DATA_NUMWORDS_MAX\fR.  Instead, the transfer size
can be as large as the source buffer.

The use of DRAM for source buffer works only when
\fIe1432_set_source_mode\fR is set to \fBE1432_SOURCE_MODE_ARB\fR, and
not when it is set to \fBE1432_SOURCE_MODE_BARB\fR.

.SH "RESET VALUES"
After a reset, \fImode\fR is set to \fBE1432_SRCBUFFER_PERIODIC_A\fR,
and \fIsize\fR is set to 1024.
.SH "RETURN VALUES"
Each function returns 0 if successful, a (negative) error number
otherwise.
.SH "SEE ALSO"
.na
e1432_set_source_mode, e1432_write_srcbuffer_data,
e1432_get_srcbuffer_size_limits
.ad
